import requests

url = 'https://www.baidu.com'

response = requests.get(url)

print(response.content.decode())

with open('baidu.html', 'w', encoding='utf-8') as f:
    f.write(response.content.decode('utf-8'))
